﻿using Iesi.Collections.Generic;
using Inovout.Models;
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Kuajing.Models
{
    public partial class ShipmentOrderItem : DataObject
    {
        public virtual Commodity Commodity { get; set; }
        public virtual ShipmentOrder ShipmentOrder { get; set; }
        private string commodityCode;
        public virtual string CommodityCode
        {
            get { return commodityCode ?? (Commodity == null ? string.Empty : Commodity.Code); }
            set { commodityCode = value; }
        }
        private string commodityMeasurementUnit;
        public virtual string CommodityMeasurementUnit
        {
            get { return commodityMeasurementUnit ?? (Commodity == null ? string.Empty : Commodity.MeasurementUnit); }
            set { commodityMeasurementUnit = value; }
        }
        public virtual float Amount { get; set; }
        private string commodityName;
        public virtual string CommodityName
        {
            get { return commodityName ?? Commodity.Name; }
            set { commodityName = value; }
        }
        public virtual Decimal CommodityPrice { get; set; }
        public virtual int CommodityQuantity { get; set; }

        public virtual object GetValue(string name)
        {
            return this.GetType().GetProperty(name).GetValue(this, null);
        }
    }
}
